﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using JsonEditor.Models;

namespace JsonEditor.Utils
{
    public class AppUtils
    {
        public static JsonNode<T> ToJsonNode<T>(TreeNode treeNode) where T : class
        {
            return new JsonNode<T>
            {
                Key = treeNode.Name,
                Value = (T)treeNode.Tag
            };
        }
    }
}
